package commands;

import observers.FileEventPublisher;
import observers.LoggerObserver;
import observers.StatsObserver;
import utils.EditorContext;

public class ExitCommand extends Command {

    public ExitCommand(EditorContext context) {
        super(context);
    }

    @Override
    public void execute() {
        FileEventPublisher.getInstance().detach(LoggerObserver.getInstance());
        FileEventPublisher.getInstance().detach(StatsObserver.getInstance());
        System.out.println("Exiting...");
        System.exit(0);
    }
}

